import Request from "@/utils/request";
import { Toast } from "vant";

export default {
    // 商户进件字典
    serverCollectionDic() {
        return Request.get("/mainIndex/dic/agent", {});
    },

    // 服务商基本信息查新
    serverBaseInfo() {
        return Request.getWithLoading(`/agent/info`, {});
    },

    // 服务商状态信息
    serverInfo() {
        return Request.get("/mainIndex/agent", {});
    },

    // 邀请码
    serverInviteCode() {
        return Request.get("/agent/extensionCode", {});
    },

    // 服务商信息查询
    serverCollectionBaseQuery(data: any) {
        return Request.get("/agent/basicInfo", data);
    },

    // 服务商信息添加
    serverCollectionBase(data: any) {
        return Request.postWithLoading("/agent/basicInfo/add", data);
    },

    // 身份正信息查询
    serverCollectionIdCardQuery() {
        return Request.get("/agent/idCard", {});
    },
    //

    // 身份正信息补全 agent/idCard/add
    serverCollectionIdCard(data: any) {
        return Request.postWithLoading("/agent/idCard/add", data);
    },

    // 进见提交
    serverCollectionSubmit() {
        return Request.postWithLoading("/agent/info/submit", {});
    },

    // -----------------------------------------

    // 下级服务商查询
    serverChild1(data: object) {
        return Request.postList(`/agent/child/list`, data);
    },

    // 下级服务商，添加
    serverChild1Add(data: object) {
        return Request.postWithLoading(`/agent/child/add`, data);
    },

    // 下级服务商详情
    serverChild1Query(code: String) {
        return Request.getWithLoading(`/agent/child/${code}`, {});
    },

    // 业务员查询
    serverChild2(data: object) {
        return Request.postList(`/salesman/list`, data);
    },

    // 业务员，添加
    serverChild2Add(mobilePhone: String) {
        return Request.postWithLoading(`/salesman/sales/add`, {
            mobilePhone: mobilePhone
        });
    },

    // 业务员详情查询
    serverChild2Query(code: String) {
        return Request.getWithLoading(
            `/salesman/sales/info/${code}`,
            {}
        );
    },

    // 商户查询
    serverChild3(data: object) {
        return Request.postList(`/mer/listByPage`, data);
    },

    // 商户详情查询
    serverChild3Query(code: String) {
        return Request.getWithLoading(`/mer/info/${code}`, {});
    }

    // ---------------------------------------------------------
    
};
